<!DOCTYPE HTML PUBLIC "-//ORA//DTD CD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>[Chapter 17] The java.util Package</TITLE>
<META NAME="author" CONTENT="Mark Grand and Jonathan Knudsen">
<META NAME="date" CONTENT="Fri Aug  8 17:41:10 1997">
<META NAME="form" CONTENT="html">
<META NAME="metadata" CONTENT="dublincore.0.1">
<META NAME="objecttype" CONTENT="book part">
<META NAME="otheragent" CONTENT="gmat dbtohtml">
<META NAME="publisher" CONTENT="O'Reilly &amp; Associates, Inc.">
<META NAME="source" CONTENT="SGML">
<META NAME="subject" CONTENT="Java">
<META NAME="title" CONTENT="Java Fundamental Classes Reference">
<META HTTP-EQUIV="Content-Script-Type" CONTENT="text/javascript">
</HEAD>
<body vlink="#551a8b" alink="#ff0000" text="#000000" bgcolor="#FFFFFF" link="#0000ee">
<script language='JavaScript'>
<!--
if (location.replace) {
 location.replace ('ch17_js.htm');
}
// -->
</script>

<DIV CLASS=htmlnav>
<H1><a href='index.htm'><IMG SRC="gifs/smbanner.gif"
     ALT="Java Fundamental Classes Reference" border=0></a></H1>
<table width=515 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=172 align=left valign=top><A HREF="ch16_19.htm"><IMG SRC="gifs/txtpreva.gif" ALT="Previous" border=0></A></td>
<td width=171 align=center valign=top><B><FONT FACE="ARIEL,HELVETICA,HELV,SANSERIF" SIZE="-1">Chapter 17</FONT></B></TD>
<td width=172 align=right valign=top><A HREF="ch17_02.htm"><IMG SRC="gifs/txtnexta.gif" ALT="Next" border=0></A></td>
</tr>
</table>

&nbsp;
<hr align=left width=515>
</DIV>
<H1 CLASS=chapter><A CLASS="TITLE" NAME="JFC-CH-17">17. The java.util Package</A></H1>

<DIV CLASS=htmltoc>

<p>
<b>Contents:</b><br>
<a href='ch17_02.htm'>Calendar</a><br>
<a href='ch17_03.htm'>Date</a><br>
<a href='ch17_04.htm'>Dictionary</a><br>
<a href='ch17_05.htm'>EmptyStackException</a><br>
<a href='ch17_06.htm'>Enumeration</a><br>
<a href='ch17_07.htm'>EventListener</a><br>
<a href='ch17_08.htm'>EventObject</a><br>
<a href='ch17_09.htm'>GregorianCalendar</a><br>
<a href='ch17_10.htm'>Hashtable</a><br>
<a href='ch17_11.htm'>ListResourceBundle</a><br>
<a href='ch17_12.htm'>Locale</a><br>
<a href='ch17_13.htm'>MissingResourceException</a><br>
<a href='ch17_14.htm'>NoSuchElementException</a><br>
<a href='ch17_15.htm'>Observable</a><br>
<a href='ch17_16.htm'>Observer</a><br>
<a href='ch17_17.htm'>Properties</a><br>
<a href='ch17_18.htm'>PropertyResourceBundle</a><br>
<a href='ch17_19.htm'>Random</a><br>
<a href='ch17_20.htm'>ResourceBundle</a><br>
<a href='ch17_21.htm'>SimpleTimeZone</a><br>
<a href='ch17_22.htm'>Stack</a><br>
<a href='ch17_23.htm'>StringTokenizer</a><br>
<a href='ch17_24.htm'>TimeZone</a><br>
<a href='ch17_25.htm'>TooManyListenersException</a><br>
<a href='ch17_26.htm'>Vector</a><br>
<p>
<p>
</DIV>

<P CLASS=para>
The package <tt CLASS=literal>java.util</tt> contains 
a number of useful classes and interfaces.  Although the name
of the package might imply that these are utility classes, they
are really more important than that.  In fact, Java depends 
directly on several of the classes in this package, and many programs 
will find these classes indispensable.  The classes and interfaces in
<tt CLASS=literal>java.util</tt> include:

<P>
<UL CLASS=itemizedlist>
<li CLASS=listitem>The <tt CLASS=literal>Hashtable</tt> class for implementing hashtables, 
or associative arrays.

<P>
<li CLASS=listitem>The <tt CLASS=literal>Vector</tt> class, which supports
variable-length arrays.

<P>
<li CLASS=listitem>The <tt CLASS=literal>Enumeration</tt> interface for iterating through
a collection of elements.

<P>
<li CLASS=listitem>The <tt CLASS=literal>StringTokenizer</tt> class for 
parsing strings into distinct tokens separated by
delimiter characters.

<P>
<li CLASS=listitem>The <tt CLASS=literal>EventObject</tt> class and the
<tt CLASS=literal>EventListener</tt> interface, which form the basis of the
new AWT event model in Java 1.1.

<P>
<li CLASS=listitem>The <tt CLASS=literal>Locale</tt> class in Java 1.1, which represents
a particular locale for internationalization purposes.

<P>
<li CLASS=listitem>The <tt CLASS=literal>Calendar</tt> and <tt CLASS=literal>TimeZone</tt> 
classes in Java.  These classes interpret 
the value of a <tt CLASS=literal>Date</tt>
object in the context of a particular calendar system.

<P>
<li CLASS=listitem>The <tt CLASS=literal>ResourceBundle</tt> class and its subclasses,
<tt CLASS=literal>ListResourceBundle</tt> and
<tt CLASS=literal>PropertyResourceBundle</tt>, which represent
sets of localized data in Java 1.1.

<P>
</UL>
<P CLASS=para>
<A HREF="ch17_01.htm#JFC-CH-17-FIG-1">Figure 17.1</A> shows the class hierarchy for
the <tt CLASS=literal>java.util</tt> package.

<DIV CLASS=figure>
<h4 CLASS=figure><A CLASS="TITLE" NAME="JFC-CH-17-FIG-1">Figure 17.1: The java.util package</A></h4>


<p>
<img align=middle src="./figs/jfc_1701.gif" alt="[Graphic: Figure 17-1]" width=502 height=623 border=0>

</DIV>

<DIV CLASS=refnamediv>
<H1>BitSet</H1>

<H2>Name</H2>

BitSet

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch17-REFSECT1-AUTOID.1">Synopsis</A></h2>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Class Name:<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>java.util.BitSet</tt>

<p>
<DT CLASS=varlistentry>Superclass:<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>java.lang.Object</tt>

<p>
<DT CLASS=varlistentry>Immediate Subclasses:<br>
<DD>

<P CLASS=para>
None

<p>
<DT CLASS=varlistentry>Interfaces Implemented:<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>java.lang.Cloneable</tt>, 
<tt CLASS=literal>java.io.Serializable</tt>

<p>
<DT CLASS=varlistentry>Availability:<br>
<DD>

<P CLASS=para>
JDK 1.0 or later </DL>
</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch17-REFSECT1-AUTOID.2">Description</A></h2>

<P CLASS=para>
The <tt CLASS=literal>BitSet</tt> class implements 
a set of bits. The set grows in size as needed. Each element of a <tt CLASS=literal>BitSet</tt> 
has a boolean value. When a <tt CLASS=literal>BitSet</tt> 
object is created, all of the bits are set to <tt CLASS=literal>false</tt> 
by default. The bits in a <tt CLASS=literal>BitSet</tt> 
are indexed by nonnegative integers, starting at 0. The size of a <tt CLASS=literal>BitSet</tt> 
is the number of bits that it currently contains. The <tt CLASS=literal>BitSet</tt> 
class provides methods to set, clear, and retrieve the values of the individual 
bits in a <tt CLASS=literal>BitSet</tt>. There are 
also methods to perform logical AND, OR, and XOR operations. 

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch17-REFSECT1-AUTOID.3">Class Summary</A></h2>

<DIV CLASS=screen>
<P>
<PRE>
public final class java.util.BitSet extends java.lang.Object
                   implements java.lang.Cloneable, java.io.Serializable {
  // Constructors
  public BitSet();
  public BitSet(int nbits);
  // Instance Methods
  public void and(BitSet set);
  public void clear(int bit);
  public Object clone();
  public boolean equals(Object obj);
  public boolean get(int bit);
  public int hashCode();
  public void or(BitSet set);
  public void set(int bit);
  public int size();
  public String toString();
  public void xor(BitSet set);
}
</PRE>
</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch17-REFSECT1-AUTOID.4">Constructors</A></h2>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch17-REFSECT2-AUTOID.1">BitSet</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch17-REFSECT3-AUTOID.1">public BitSet()</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This constructor creates <tt CLASS=literal>a BitSet</tt> 
with a default size of 64 bits. All of the bits in the <tt CLASS=literal>BitSet</tt> 
are initially set to <tt CLASS=literal>false</tt>. </DL>
</DIV>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch17-REFSECT3-AUTOID.2">public BitSet(int nbits)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>nbits</tt><br>
<DD>

<P CLASS=para>
The initial number of bits. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This constructor creates a <tt CLASS=literal>BitSet</tt> 
with a size of <tt CLASS=literal>nbits</tt>. All of 
the bits in the <tt CLASS=literal>BitSet</tt> are 
initially set to <tt CLASS=literal>false</tt>. </DL>
</DIV>

</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch17-REFSECT1-AUTOID.5">Instance Methods</A></h2>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch17-REFSECT2-AUTOID.2">and</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch17-REFSECT3-AUTOID.3">public void and(BitSet set)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>set</tt><br>
<DD>

<P CLASS=para>
The <tt CLASS=literal>BitSet</tt> 
to AND with this<tt CLASS=literal> BitSet</tt>. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method computes the logical AND of this <tt CLASS=literal>BitSet</tt> 
and the specified <tt CLASS=literal>BitSet</tt> and 
stores the result in this <tt CLASS=literal>BitSet</tt>. 
In other words, for each bit in this <tt CLASS=literal>BitSet</tt>, 
the value is set to only <tt CLASS=literal>true</tt> 
if the bit is already <tt CLASS=literal>true</tt> 
in this <tt CLASS=literal>BitSet</tt> and the corresponding 
bit in <tt CLASS=literal>set</tt> is <tt CLASS=literal>true</tt>.

<P CLASS=para>
If the size of <tt CLASS=literal>set</tt> is greater 
than the size of this <tt CLASS=literal>BitSet</tt>, 
the extra bits in <tt CLASS=literal>set</tt> are ignored. 
If the size of <tt CLASS=literal>set</tt> is less 
than the size of this <tt CLASS=literal>BitSet</tt>, 
the extra bits in this <tt CLASS=literal>BitSet</tt> 
are set to <tt CLASS=literal>false</tt>. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch17-REFSECT2-AUTOID.3">clear</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch17-REFSECT3-AUTOID.4">public void clear(int bit)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>bit</tt><br>
<DD>

<P CLASS=para>
The index of the bit 
to clear. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method sets the bit at the given index to <tt CLASS=literal>false</tt>. 
If <tt CLASS=literal>bit</tt> is greater than or equal 
to the number of bits in the <tt CLASS=literal>BitSet</tt>, 
the size of the <tt CLASS=literal>BitSet</tt> is increased 
so that it contains <tt CLASS=literal>bit</tt> values. 
All of the additional bits are set to <tt CLASS=literal>false</tt>. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch17-REFSECT2-AUTOID.4">clone</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch17-REFSECT3-AUTOID.5">public Object clone()</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
A copy of this <tt CLASS=literal>BitSet</tt>. 

<p>
<DT CLASS=varlistentry>Overrides<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>Object.clone()</tt> 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method creates a copy of this <tt CLASS=literal>BitSet</tt> 
and returns it. In other words, the returned <tt CLASS=literal>BitSet</tt> 
has the same size as this <tt CLASS=literal>BitSet</tt>, 
and it has the same bits set to <tt CLASS=literal>true</tt>. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch17-REFSECT2-AUTOID.5">equals</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch17-REFSECT3-AUTOID.6">public boolean equals(Object obj)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>obj</tt><br>
<DD>

<P CLASS=para>
The object to be compared 
with this object. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>true</tt> if the objects are equal; 
<tt CLASS=literal>false</tt> if they are not. 

<p>
<DT CLASS=varlistentry>Overrides<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>Object.equals()</tt> 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method returns <tt CLASS=literal>true</tt> if 
<tt CLASS=literal>obj</tt> is an instance of <tt CLASS=literal>BitSet</tt> 
and it contains the same bit values as the object this method is associated 
with. In other words, this method compares each bit of this <tt CLASS=literal>BitSet</tt> 
with the corresponding bit of <tt CLASS=literal>obj</tt>. 
If any bits do not match, the method returns <tt CLASS=literal>false</tt>. 
If the size of this <tt CLASS=literal>BitSet</tt> 
is different than <tt CLASS=literal>obj</tt>, the 
extra bits in either this <tt CLASS=literal>BitSet</tt> 
or in <tt CLASS=literal>obj</tt> must be <tt CLASS=literal>false</tt> 
for this method to return <tt CLASS=literal>true</tt>. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch17-REFSECT2-AUTOID.6">get</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch17-REFSECT3-AUTOID.7">public boolean get(int bit)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>bit</tt><br>
<DD>

<P CLASS=para>
The index of the bit 
to retrieve. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The <tt CLASS=literal>boolean</tt> value of the bit 
at the given index. 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method returns the value of the given bit. If <tt CLASS=literal>bit</tt> 
is greater than or equal to the number of bits in the <tt CLASS=literal>BitSet</tt>, 
the method returns <tt CLASS=literal>false</tt>. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch17-REFSECT2-AUTOID.7">hashCode</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch17-REFSECT3-AUTOID.8">public int hashCode()</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The hashcode for this <tt CLASS=literal>BitSet</tt>. 

<p>
<DT CLASS=varlistentry>Overrides<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>Object.hashCode()</tt> 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method returns a hashcode for this object. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch17-REFSECT2-AUTOID.8">or</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch17-REFSECT3-AUTOID.9">public void or(BitSet set)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>set</tt><br>
<DD>

<P CLASS=para>
The <tt CLASS=literal>BitSet</tt> 
to OR with this<tt CLASS=literal> BitSet</tt>. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method computes the logical OR of this <tt CLASS=literal>BitSet</tt> 
and the specified <tt CLASS=literal>BitSet</tt>, and 
stores the result in this <tt CLASS=literal>BitSet</tt>. 
In other words, for each bit in this <tt CLASS=literal>BitSet</tt>, 
the value is set to <tt CLASS=literal>true</tt> if 
the bit is already <tt CLASS=literal>true</tt> in 
this <tt CLASS=literal>BitSet</tt> or the corresponding 
bit in <tt CLASS=literal>set</tt> is <tt CLASS=literal>true</tt>.

<P CLASS=para>
If the size of <tt CLASS=literal>set</tt> is greater 
than the size of this <tt CLASS=literal>BitSet</tt>, 
this <tt CLASS=literal>BitSet</tt> is first increased 
in size to accommodate the additional bits. All of the additional bits 
are initially set to <tt CLASS=literal>false</tt>. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch17-REFSECT2-AUTOID.9">set</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch17-REFSECT3-AUTOID.10">public void set(int bit)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>bit</tt><br>
<DD>

<P CLASS=para>
The index of the bit 
to set. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method sets the bit at the given index to <tt CLASS=literal>true</tt>. 
If <tt CLASS=literal>bit</tt> is greater than or equal 
to the number of bits in the <tt CLASS=literal>BitSet</tt>, 
the size of the <tt CLASS=literal>BitSet</tt> is increased 
so that it contains <tt CLASS=literal>bit</tt> values. 
All of the additional bits except the last one are set to <tt CLASS=literal>false</tt>. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch17-REFSECT2-AUTOID.10">size</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch17-REFSECT3-AUTOID.11">public int size()</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The size of this <tt CLASS=literal>BitSet</tt>. 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method returns the size of this <tt CLASS=literal>BitSet</tt>, 
which is the number of bits currently in the set. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch17-REFSECT2-AUTOID.11">toString</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch17-REFSECT3-AUTOID.12">public String toString()</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
A string representation of this <tt CLASS=literal>BitSet</tt>. 

<p>
<DT CLASS=varlistentry>Overrides<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>Object.toString()</tt> 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method returns a string representation of this <tt CLASS=literal>BitSet</tt>. 
The string lists the indexes of all the bits in the <tt CLASS=literal>BitSet</tt> 
that are <tt CLASS=literal>true</tt>. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch17-REFSECT2-AUTOID.12">xor</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch17-REFSECT3-AUTOID.13">public void xor(BitSet set)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>set</tt><br>
<DD>

<P CLASS=para>
The <tt CLASS=literal>BitSet</tt> 
to XOR with this<tt CLASS=literal> BitSet</tt>. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method computes the logical XOR (exclusive OR) of this <tt CLASS=literal>BitSet</tt> 
and the specified <tt CLASS=literal>BitSet</tt> and 
stores the result in this <tt CLASS=literal>BitSet</tt>. 
In other words, for each bit in this <tt CLASS=literal>BitSet</tt>, 
the value is set to <tt CLASS=literal>true</tt> only 
if the bit is already <tt CLASS=literal>true</tt> 
in this <tt CLASS=literal>BitSet</tt>, and the corresponding 
bit in <tt CLASS=literal>set</tt> is <tt CLASS=literal>false</tt>, 
or if the bit is <tt CLASS=literal>false</tt> in this 
<tt CLASS=literal>BitSet</tt> and the corresponding 
bit in <tt CLASS=literal>set</tt> is <tt CLASS=literal>true</tt>.

<P CLASS=para>
If the size of <tt CLASS=literal>set</tt> is greater 
than the size of this <tt CLASS=literal>BitSet</tt>, 
this <tt CLASS=literal>BitSet</tt> is first increased 
in size to accommodate the additional bits. All of the additional bits 
are initially set to <tt CLASS=literal>false</tt>. </DL>
</DIV>

</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch17-REFSECT1-AUTOID.6">Inherited Methods</A></h2>

<DIV CLASS=informaltable>
<P>
<TABLE CLASS=INFORMALTABLE>
<TR CLASS=row>
<TH ALIGN="LEFT">

<P CLASS=para>
Method</TH>
<TH ALIGN="LEFT">

<P CLASS=para>
Inherited From</TH>
<TH ALIGN="LEFT">

<P CLASS=para>
Method</TH>
<TH ALIGN="LEFT">

<P CLASS=para>
Inherited From</TH>
</TR>
<TR CLASS=row>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>finalize()</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>getClass()</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
</TR>
<TR CLASS=row>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>notify()</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>notifyAll()</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
</TR>
<TR CLASS=row>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>wait()</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>wait(long)</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
</TR>
<TR CLASS=row>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>wait(long, int)</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
<TD ALIGN="LEFT">&nbsp;</TD>
<TD ALIGN="LEFT">&nbsp;</TD>
</TR>
</TABLE>
<P>
</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch17-REFSECT1-AUTOID.7">See Also</A></h2>

<P CLASS=para>
<tt CLASS=literal>Cloneable</tt>, 
<tt CLASS=literal>Serializable</tt> 
</DIV>


<DIV CLASS=htmlnav>

<P>
<HR align=left width=515>
<table width=515 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=172 align=left valign=top><A HREF="ch17_26.htm"><IMG SRC="gifs/txtpreva.gif" ALT="Previous" border=0></A></td>
<td width=171 align=center valign=top><a href="index.htm"><img src='gifs/txthome.gif' border=0 alt='Home'></a></td>
<td width=172 align=right valign=top><A HREF="ch17_02.htm"><IMG SRC="gifs/txtnexta.gif" ALT="Next" border=0></A></td>
</tr>
<tr>
<td width=172 align=left valign=top>Vector</td>
<td width=171 align=center valign=top><a href="index/idx_0.htm"><img src='gifs/index.gif' alt='Book Index' border=0></a></td>
<td width=172 align=right valign=top>Calendar</td>
</tr>
</table>
<hr align=left width=515>

<IMG SRC="gifs/smnavbar.gif" USEMAP="#map" BORDER=0> 
<MAP NAME="map"> 
<AREA SHAPE=RECT COORDS="0,0,108,15" HREF="../javanut/index.htm"
alt="Java in a Nutshell"> 
<AREA SHAPE=RECT COORDS="109,0,200,15" HREF="../langref/index.htm" 
alt="Java Language Reference"> 
<AREA SHAPE=RECT COORDS="203,0,290,15" HREF="../awt/index.htm" 
alt="Java AWT"> 
<AREA SHAPE=RECT COORDS="291,0,419,15" HREF="../fclass/index.htm" 
alt="Java Fundamental Classes"> 
<AREA SHAPE=RECT COORDS="421,0,514,15" HREF="../exp/index.htm" 
alt="Exploring Java"> 
</MAP>
</DIV>

</BODY>
</HTML>
